package com.demo2do.fms.admin.web.controller.authority.infrastructure;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.demo2do.core.web.interceptor.MenuSetting;
import com.demo2do.fms.admin.service.authority.OrganizationService;
import com.demo2do.fms.entity.authority.Organization;

/**
 * 专属供应商
 * 
 * @author Wy
 *
 */
@Controller
@RequestMapping("/organizations")
@MenuSetting("menu-authority")
public class OrganizationController {
    
    @Autowired
    private OrganizationService organizationService;
    
    /**
     * 
     * @return
     */
    @RequestMapping(value = "" , method = RequestMethod.GET)
    @MenuSetting("submenu-core-supplier-management")
    public ModelAndView list(){
        
        ModelAndView modelAndView = new ModelAndView("authority/infrastructure/organization/organization-list");
        
        //list all system organizations
        List<Organization> organizations = organizationService.listSystemOrganization();
        modelAndView.addObject("organizations", organizations);
        
        return modelAndView;
        
    }
    

}
